package com.ghy.nba.services;

import com.ghy.nba.dao.BallStarRepository;
import com.ghy.nba.entities.BallStar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BallstarService {

    @Autowired
    BallStarRepository ballStarRepository;

    public BallStar save(BallStar ballStar){return ballStarRepository.save(ballStar);}

    public List<BallStar> getALL(){return ballStarRepository.findAll();}

    public BallStar findByBallstarId(long theId){

        return ballStarRepository.findByBallstarId(theId);
    }

    public void delete(BallStar theBallstar){

        ballStarRepository.delete(theBallstar);
    }
}
